<?php
abstract class Domain
{
	protected $_suffixes;
	public function __construct()
	{
		if (empty($_POST['suffixes'])) die('suffixes is must');
		$this->_suffixes = $_POST['suffixes'];
	}
	
	protected function addSuffixes($domains)
	{
		$type = gettype($domains);
		$resDomain = array();
		//var_dump($type);
		
		if ($type == 'array') {
			foreach ($this->_suffixes as $suffix) {
				foreach ($domains as &$domain) {				
					$resDomain[] = $domain.$suffix;
				}
			}
			return $resDomain;
		} elseif ($type == 'string') {
			foreach ($this->_suffixes as $suffix) {
				$resDomain[] = $domains.$suffix;
			}
			return $resDomain;
		}
	}
}
?>